<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>广软课程论坛</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .post-card {
            transition: all 0.3s ease;
            margin-bottom: 15px;
        }
        .post-card:hover {
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            transform: translateY(-3px);
        }
        .category-active {
            background-color: #0d6efd;
            color: white !important;
        }
        .avatar-sm {
            width: 30px;
            height: 30px;
            border-radius: 50%;
        }
        a {
            text-decoration: none; /* 去除下划线 */
            color: black; /* 设置链接颜色为蓝色 */
            transition: color 0.3s; /* 添加颜色过渡效果 */
        }
    </style>
</head>
<body>
<!-- 导航栏 -->
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
    <div class="container">
        <a class="navbar-brand" href="#">广软课程论坛</a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav me-auto">
                <li class="nav-item">
                    <a class="nav-link active" href="index.jsp">首页</a>
                </li>
            </ul>
            <form class="d-flex me-2" action="/post/search" method="get">
                <input class="form-control me-2" type="search" name="keyword" placeholder="搜索帖子..." aria-label="Search">
                <button class="btn btn-outline-light" type="submit">搜索</button>
            </form>
                    <div class="dropdown">
                        <a href="#" class="d-flex align-items-center text-white text-decoration-none dropdown-toggle" id="dropdownUser" data-bs-toggle="dropdown">
                            <img src="https://img0.baidu.com/it/u=3985150573,583103601&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500" alt="头像" class="avatar-sm me-2">
                            <span></span>
                        </a>
                        <ul class="dropdown-menu dropdown-menu-end">
                            <li><a class="dropdown-item" href="PersonInfo.jsp">个人中心</a></li>
                            <li><a class="dropdown-item" href="AddNewPost.jsp">发布新帖</a></li>

                                <li><hr class="dropdown-divider"></li>
                                <li><a class="dropdown-item" href="/admin/dashboard">管理后台</a></li>

                            <li><hr class="dropdown-divider"></li>
                            <li><a class="dropdown-item" href="/logout">退出登录</a></li>
                        </ul>
                    </div>


                    <a href="Login.jsp" class="btn btn-outline-light me-2">登录</a>
                    <a href="Register.jsp" class="btn btn-light">注册</a>

        </div>
    </div>
</nav>

<!-- 主内容区 -->
<div class="container mt-4">
    <div class="row">
        <!-- 左侧分类导航 -->
        <div class="col-md-3">
            <div class="card mb-4">
                <div class="card-header bg-primary text-white">
                    <i class="bi bi-list-ul"></i> 帖子分类
                </div>
                <div class="list-group list-group-flush">
                    <a href="TagSearch.jsp">求助帖</a>
                </div>
                <div class="list-group list-group-flush">
                    <a href="TagSearch.jsp">赞赏贴</a>
                </div>
                <div class="list-group list-group-flush">
                    <a href="TagSearch.jsp">生活贴</a>
                </div>
            </div>

            <!-- 热门课程 -->
            <div class="card">
                <div class="card-header bg-success text-white">
                    <i class="bi bi-book"></i> 热门课程
                </div>

                <div class="list-group list-group-flush">
<%--                    课程名字--%>
                    <a href="TagSearch.jsp" class="list-group-item list-group-item-action">
                        javaEE 课程
<%--                        课程的总帖子数--%>
                        <span class="badge bg-primary rounded-pill float-end">999</span>
                    </a>
                </div>
                <div class="list-group list-group-flush">
                    <%--                    课程名字--%>
                    <a href="TagSearch.jsp" class="list-group-item list-group-item-action">
                        VUE 课程
                        <%--                        课程的总帖子数--%>
                        <span class="badge bg-primary rounded-pill float-end">222</span>
                    </a>
                </div>
                <div class="list-group list-group-flush">
                    <%--                    课程名字--%>
                    <a href="TagSearch.jsp" class="list-group-item list-group-item-action">
                        MySql课程
                        <%--                        课程的总帖子数--%>
                        <span class="badge bg-primary rounded-pill float-end">666</span>
                    </a>
                </div>
            </div>
        </div>

        <!-- 右侧帖子列表 -->
        <div class="col-md-9">
            <div class="d-flex justify-content-between align-items-center mb-3">
<%--                <h4>--%>
<%--                    <c:choose>--%>
<%--                        <c:when test="${not empty param.categoryId}">--%>
<%--                            ${currentCategory.name} 帖子--%>
<%--                        </c:when>--%>
<%--                        <c:otherwise>--%>
<%--                            最新帖子--%>
<%--                        </c:otherwise>--%>
<%--                    </c:choose>--%>
<%--                </h4>--%>
                    <h4>
<%--                        欢迎的提示--%>
                        欢迎你 -  用户名字 --  -角色名字-，今天又有什么新内容呢？
                    </h4>
                <a href="AddNewPost.jsp" class="btn btn-primary">
                    <i class="bi bi-plus-lg"></i> 发布新帖
                </a>
            </div>

            <!-- 帖子列表 -->
<%--                一条帖子的身体--%>
            <div class="card post-card">
                    <a href="PostDetails.jsp">
                        <div class="card-body">
                            <div class="d-flex justify-content-between">
                                <h5 class="card-title">
                                    <%--                                置顶的帖子--%>
                                    <%--                                <c:if test="${post.status == 2}">--%>
                                    <span class="badge bg-danger ms-2">置顶</span>
                                    <%--                                </c:if>--%>
                                </h5>
                                <%--                            帖子查看的数量--%>
                                <span class="text-muted small">
                                    <i class="bi bi-eye">999</i>
                                </span>
                            </div>
                            <h3>小白必看！JavaEE 学习秘籍大公开</h3>
                            <p >JavaEE 是企业级开发的关键技术，想学好它，要分阶段进行。首先，打好 Java 基础，掌握面向对象编程等核心知识。接着，学习 Servlet、JSP 等 JavaEE 核心技术，理解原理与应用场景。最后，多做项目实践，如小型 Web 应用。还可参考优质教程和开源项目，不断积累经验。</p>
                            <div class="d-flex justify-content-between align-items-center">
                                <div>
<%--                                    头像--%>
                                    <img src="https://img0.baidu.com/it/u=3985150573,583103601&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500" alt="头像" class="avatar-sm me-2">
                                    <a href="/user/profile?id=" class="text-decoration-none">用户名字</a>
                                    <span class="text-muted small md-2"></span>
                                </div>
                                <div>
                                    <span class="badge bg-secondary me-2"></span>
                                    <span class="text-muted small">
                                        <i class="bi bi-chat-left-text"></i>
                                </span>
                                </div>
                            </div>
                        </div>
                    </a>
            </div>
            <div class="card post-card">
                <a href="PostDetails.jsp">
                    <div class="card-body">
                        <div class="d-flex justify-content-between">
                            <h5 class="card-title">
                                <%--                                置顶的帖子--%>
                                <%--                                <c:if test="${post.status == 2}">--%>
                                <span class="badge bg-danger ms-2">置顶</span>
                                <%--                                </c:if>--%>
                            </h5>
                            <%--                            帖子查看的数量--%>
                            <span class="text-muted small">
                                    <i class="bi bi-eye">999</i>
                                </span>
                        </div>
                        <h3>小白必看！JavaEE 学习秘籍大公开</h3>
                        <p >JavaEE 是企业级开发的关键技术，想学好它，要分阶段进行。首先，打好 Java 基础，掌握面向对象编程等核心知识。接着，学习 Servlet、JSP 等 JavaEE 核心技术，理解原理与应用场景。最后，多做项目实践，如小型 Web 应用。还可参考优质教程和开源项目，不断积累经验。</p>
                        <div class="d-flex justify-content-between align-items-center">
                            <div>
                                <img src="https://img0.baidu.com/it/u=3985150573,583103601&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500" alt="头像" class="avatar-sm me-2">
                                <a href="/user/profile?id=" class="text-decoration-none"></a>
                                <span class="text-muted small ms-2"></span>
                            </div>
                            <div>
                                <span class="badge bg-secondary me-2"></span>
                                <span class="text-muted small">
                                        <i class="bi bi-chat-left-text"></i>
                                </span>
                            </div>
                        </div>
                    </div>
                </a>
            </div>



<%--                <div class="card post-card">--%>
<%--                <div class="card-body">--%>
<%--                    <div class="d-flex justify-content-between">--%>
<%--                        <h5 class="card-title">--%>
<%--                            <a href="/post/detail" class="text-decoration-none"></a>--%>
<%--                            &lt;%&ndash;                                置顶的帖子&ndash;%&gt;--%>
<%--                            &lt;%&ndash;                                <c:if test="${post.status == 2}">&ndash;%&gt;--%>
<%--                            <span class="badge bg-danger ms-2">置顶</span>--%>
<%--                            &lt;%&ndash;                                </c:if>&ndash;%&gt;--%>
<%--                        </h5>--%>
<%--                        &lt;%&ndash;                            帖子查看的数量&ndash;%&gt;--%>
<%--                        <span class="text-muted small">--%>
<%--                                    <i class="bi bi-eye">999</i>--%>
<%--                                </span>--%>
<%--                    </div>--%>
<%--                    <h3>小白必看！JavaEE 学习秘籍大公开</h3>--%>
<%--                    <p >JavaEE 是企业级开发的关键技术，想学好它，要分阶段进行。首先，打好 Java 基础，掌握面向对象编程等核心知识。接着，学习 Servlet、JSP 等 JavaEE 核心技术，理解原理与应用场景。最后，多做项目实践，如小型 Web 应用。还可参考优质教程和开源项目，不断积累经验。</p>--%>
<%--                    <div class="d-flex justify-content-between align-items-center">--%>
<%--                        <div>--%>
<%--                            <img src="https://img0.baidu.com/it/u=3985150573,583103601&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500" alt="头像" class="avatar-sm me-2">--%>
<%--                            <a href="/user/profile?id=" class="text-decoration-none"></a>--%>
<%--                            <span class="text-muted small ms-2"></span>--%>
<%--                        </div>--%>
<%--                        <div>--%>
<%--                            <span class="badge bg-secondary me-2"></span>--%>
<%--                            <span class="text-muted small">--%>
<%--                                        <i class="bi bi-chat-left-text"></i>--%>
<%--                                    </span>--%>
<%--                        </div>--%>
<%--                    </div>--%>
<%--                </div>--%>
<%--            </div>--%>

            <!-- 分页 -->
            <nav aria-label="Page navigation" class="mt-4">
                <ul class="pagination justify-content-center">
<%--                    <c:if test="${pageInfo.hasPreviousPage}">--%>
                        <li class="page-item">
                            <a class="page-link" href="">上一页</a>
                        </li>
<%--                    </c:if>--%>

<%--                    <c:forEach items="${pageInfo.navigatepageNums}" var="pageNum">--%>
                        <li class="page-item  active}">
                            <a class="page-link" href="">1</a>
                        </li>
<%--                    </c:forEach>--%>

<%--                    <c:if test="${pageInfo.hasNextPage}">--%>
                        <li class="page-item">
                            <a class="page-link" href="">下一页</a>
                        </li>
<%--                    </c:if>--%>
                </ul>
            </nav>
        </div>
    </div>
</div>

<!-- 页脚 -->
<footer class="bg-light text-center text-lg-end fixed-bottom">
    <div class="text-center p-3 bg-primary text-white">
        © 2025 广州软件学院课程论坛
    </div>
</footer>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>